 {layout name="common/layout" /}
<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>

<div class="Hui-article-box" style="margin-top: 37px;">
	<div class="breadcrumb"><i class="Hui-iconfont"></i>商品
	<span class="c-gray en">&gt;</span> 商品详情模板 <span class="c-gray en">&gt;</span> 
	</div>
	<div class="Hui-article">
			<div style="overflow: hidden;width: 1000px;height: 100px;border:1px solid #ccc;margin:20px auto;">
				<div style="float: left;margin-left: 30px;">
					<h3>商品详情模板</h3>
					<span>商品/商品详情模板</span>
				</div>
				<div style="float: right;margin-right: 30px;"><a class="box-btn" href="{:url('goodsdetails/create')}">添加商品详情模板</a></div>
			</div>
			<div class="mt-20" style="width: 1000px;margin:20px auto;">
				
				<table class="table table-border table-bg  table-bordered" style="margin-bottom: 20px;line-height: 30px;height: 30px;">
 						<tr class="text-c">
 							<td>名称</td>
 							<td width="600px;">创建时间</td>
 							<td>操作</td>
  						</tr>
  						{foreach($data as $k => $v)}
  						<tr style="height: 120px;" class="text-c">
 							<td>{$v['goods_details_name']}</td>
 							<td>{$v['goods_details_create_time']}</td>
 							<td><a href="{:url('goodsdetails/update', ['id' => $v['goods_details_id']])}" class="aa btn">修改</a><br><button class="aa btn" onclick="del({$v['goods_details_id']}, {:session('merchant')['merchant_id']});">删除</button></td>
  						</tr>
  						{/foreach}
					</table>
				<div class="cl">
						{$data->render()} 
					</div>
			</div>
	</div>
</div>
	
 
<script>
	$(function(){
	$.Huitab("#tab_demo .tabBar span","#tab_demo .tabCon","current","click","0")});
	var GG = {
        "kk":function(mm){
           var ym=mm;
        }
    }
	$(".paginate").initPage(71,1,GG.kk);
	 


	function del(id)
	{	
		layer.msg('你确定要删除吗？', {
		  time: 0, 
		  btn: ['确定', '取消'],
		  area: ['250px', '120px'],
		  btnAlign: 'c',
		  yes: function(index){
	    	layer.close(index);
	    	$.ajax({
			type : 'get',
			url : "<?php echo url('goodsdetails/delete', '', false); ?>/id/" + id,
			dataType : 'json',
			success : function(data){
				layer.msg(data.msg, {
				  offset: 't',
				  anim: 5,
				  success : function(){
				  	location.reload();
				  }
				});
			}
		});
		  }
		});		
		
	}
</script>
 